import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
import Components from 'unplugin-vue-components/dist/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/dist/resolvers';

import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
	  viteCommonjs(),
	  Components({
		  resolvers: [
			  AntDesignVueResolver({
				  importStyle: false
			  })
		  ]
	  })
  ],
  resolve: {
		dedupe: [
			'vue'
		],
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
	server: {
		host: '0.0.0.0'
	}
})
